
<template>
  <div id="headers">
    <header>
      <div class="top-banner">
        <a href="#"> </a>
      </div>
      <div class="top-nav">
        <div class="nav-con w">
          <div class="nav-left">
            <ul>
              <li v-for="(item, i) in topNav" :key="i">{{ item }}</li>
            </ul>
          </div>
          <div class="nav-right">
            <ul>
              <li>登录</li>
              <li>注册</li>
              <li>消息通知</li>
            </ul>
            <div class="car">购物车 （0）</div>
          </div>
        </div>
      </div>
    </header>
  </div>
</template>

<script>
export default {
  //组件
  components: {},
  //数据
  data() {
    return {
      topNav: [
        "小米商城",
        "MIUI",
        "loT",
        "云服务",
        "天星数科",
        "有品",
        "小爱开放平台",
        "企业团购",
        "资质证照",
        "协议规则",
        "下载APP",
        "智能生活",
        "Select Location",
      ],
    };
  },
  //挂载后
  mounted() {},
  //方法
  methods: {},
  //过滤，筛选
  filters: {},
  //计算
  computed: {},
  //监听
  watch: {
    //被监听者名称
    $route: {
      //是否一进入页面就开始监听
      immediate: false,
      //执行函数
      handler(newVal, oldVal) {},
      //是否深度监听
      deep: false,
    },
  },
};
</script>

<style lang='scss' scoped>
#headers {

  header {
    .top-banner {
      width: 100%;
      height: 120px;
      a {
        display: block;
        width: 100%;
        height: 100%;
        background: no-repeat
          url(https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/49aa1df3471f88dd2235db8a40785977.jpg?w=5120&h=240);
        background-position: 50%;
        background-size: auto 120px;
        img {
          width: 130%;
          height: 100%;
        }
      }
    }
    .top-nav {
      width: 100%;
      height: 40px;
      background-color: #333;
      ul {
        display: flex;
        color: #b0b0b0;
        align-items: center;
        height: 40px;
        li {
          font-size: 12px;
          padding: 0 6px;
          border-right: 1px solid #505050;
        }
        :nth-child(1) {
          padding-right: 6px;
        }
        li:hover {
          color: white;
        }
      }
      .nav-left {
        float: left;
        width: 800px;
      }
      .nav-right {
        float: right;
        display: flex;
        .car {
          width: 100px;
          background-color: #424242;
          margin-left: 10px;
          color: #b0b0b0;
          font-size: 12px;
          line-height: 40px;
          text-align: center;
        }
      }
    }
  }
}
</style>
